import config from '@/config'
import http from '@/utils/request.js'

export default {
    add: {
        name: '添加新权限',
        url: `${config.API_URL}/permission/add`,
        async post(data) {
            return await http.post(this.url, data)
        },
        async get(data) {
            return await http.get(this.url, data)
        }
    },
    update: {
        name: '更新权限',
        url: `${config.API_URL}/permission/update`,
        async post(data) {
            return await http.post(this.url, data)
        },
        async get(data) {
            return await http.get(this.url, data)
        }
    },
    list: {
        name: '获取权限列表',
        url: `${config.API_URL}/permission/list`,
        async post(data) {
            return await http.post(this.url, data)
        },
        async get(data) {
            return await http.get(this.url, data)
        }
    },
    details: {
        name: '获取权限详情',
        url: `${config.API_URL}/permission/details`,
        async post(data) {
            return await http.post(this.url, data)
        },
        async get(data) {
            return await http.get(this.url, data)
        }
    },
    delete: {
        name: '删除权限项',
        url: `${config.API_URL}/permission/delete`,
        async post(data) {
            return await http.post(this.url, data)
        },
        async get(data) {
            return await http.get(this.url, data)
        }
    }
}
